﻿#region using statements

using Microsoft.Xna.Framework;

using NGen;
using NGen.Managers.GUI;
using NGen.Managers.GameState;

using TowerDefense.GUILayouts;

#endregion

namespace TowerDefense.States
{
	/// <summary>
	/// 	State of the game when the base menu is displayed
	/// </summary>
	public class GameStateMenu : GameState
	{
		/// <summary>
		/// 	The gui presented in this state
		/// </summary>
		private readonly GUIElement m_gui = new GUIElementMenuStateLayout();

		/// <summary>
		/// 	_Initialize this state
		/// </summary>
		protected override void _Initialize() {
			GameEngine.GetService<IManagerGUI>().AddElement(m_gui);
		}

		/// <summary>
		/// 	Cleanup this state
		/// </summary>
		protected override void _Cleanup() {
			GameEngine.GetService<IManagerGUI>().RemoveElement(m_gui);
		}

		/// <summary>
		/// 	Called whenever this state is no longer the active state
		/// </summary>
		protected override void _OnFocusLost() {}

		/// <summary>
		/// 	Called whenever this state becomes the active state
		/// </summary>
		protected override void _OnFocusGained() {}

		/// <summary>
		/// 	Update this game state
		/// </summary>
		/// <param name = "p_gameTime">snapshot of timing values</param>
		protected override void _Update(GameTime p_gameTime) {}

		/// <summary>
		/// 	Draw this game state
		/// </summary>
		/// <param name = "p_gameTime">snapshot of timing values</param>
		protected override void _Draw(GameTime p_gameTime) {
			GameEngine.GraphicsDeviceManager.GraphicsDevice.Clear(Color.Blue);
		}
	}
}